{# Logo link generation -#}
{% if not theme_logo.get("link") %}
{% set href = pathto(root_doc) %}
{% elif hasdoc(theme_logo.get("link")) %}
{% set href = pathto(theme_logo.get("link")) %} {# internal page #}
{% else %}
{% set href = theme_logo.get("link") %} {# external url #}
{% endif %}

{#- Logo HTML and image #}
<a class="navbar-brand logo" href="{{ href }}">
    <!-- TODO: Dark/light toggling does not work for SVGs in Navbar, we instead hardcode the logo SVG here and toggle the text color based on dark/light defined in custom.css. -->
    <?xml version="1.0" encoding="utf-8"?>
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
         viewBox="0 0 2548.7 702.5" style="enable-background:new 0 0 2548.7 702.5;" xml:space="preserve">
    <style type="text/css">
        .st0{clip-path:url(#SVGID_2_);}
        .st1{fill:#372F8A;}
        .st2{fill:#195D7F;}
        .st3{fill:#39A4DD;}
        .st4{fill:var(--logo-text-color);}
    </style>
    <g>
        <defs>
            <rect id="SVGID_1_" x="165.2" y="122.6" width="2190" height="477"/>
        </defs>
        <clipPath id="SVGID_2_">
            <use xlink:href="#SVGID_1_"  style="overflow:visible;"/>
        </clipPath>
        <g class="st0">
            <path class="st1" d="M387.5,403.7l-53.2,7.8l132.5,132.6l-21.3-82.4L387.5,403.7z"/>
            <path class="st1" d="M586.3,122.6L165.2,242.2l132.5,132.6l12.5-57.1l-57-57.1l271.6-76.5C524.7,184.1,578.6,130.4,586.3,122.6
                L586.3,122.6z"/>
            <path class="st1" d="M524.7,184l-79.2,277.7l21.3,82.4l119.5-421.5C578.6,130.4,524.7,184,524.7,184L524.7,184z"/>
            <path class="st2" d="M353,356.1l-18.7,55.3l53.2-7.8L435.3,274l-0.4,0.1L353,356.1z"/>
            <path class="st3" d="M310.2,317.6l-12.5,57.2l55.3-18.7l81.9-82L310.2,317.6z"/>
            <path class="st4" d="M905.3,412.6c0-12.9-4.6-22.9-13.7-29.8c-9.1-6.9-25.6-14.2-49.3-21.9c-23.7-7.7-42.5-15.3-56.3-22.7
                c-37.7-20.4-56.6-47.9-56.6-82.4c0-18,5.1-34,15.2-48.1c10.1-14.1,24.6-25.1,43.6-33c18.9-7.9,40.2-11.9,63.8-11.9
                c23.6,0,44.9,4.3,63.4,12.9c18.6,8.6,33,20.7,43.2,36.4c10.3,15.7,15.4,33.5,15.4,53.4h-68.4c0-15.2-4.8-27.1-14.4-35.5
                c-9.6-8.5-23-12.7-40.4-12.7c-17.3,0-29.7,3.5-39,10.6c-9.3,7.1-13.9,16.4-13.9,28c0,10.8,5.4,19.9,16.3,27.2
                c10.9,7.3,26.9,14.2,48,20.5c38.9,11.7,67.3,26.3,85.1,43.6c17.8,17.4,26.7,39,26.7,64.8c0,28.8-10.9,51.3-32.6,67.7
                c-21.7,16.4-51,24.5-87.8,24.5c-25.6,0-48.8-4.7-69.8-14c-21-9.4-37-22.2-48-38.5c-11-16.3-16.5-35.2-16.5-56.6h68.7
                c0,36.7,21.9,55,65.7,55c16.3,0,29-3.3,38.1-9.9C900.8,433.7,905.3,424.5,905.3,412.6L905.3,412.6z"/>
            <path class="st4" d="M1093.9,400.7l-23.7,23.7v75.3h-65.9V149.1h65.9v194.3L1083,327l63.2-74.2h79.2l-89.2,103l96.9,144.1h-75.7
                L1093.9,400.7L1093.9,400.7z"/>
            <path class="st4" d="M1334.3,406.4l45.6-153.7h70.7l-99.2,285.4l-5.5,13c-14.8,32.3-39.1,48.4-73,48.4c-9.6,0-19.3-1.4-29.2-4.3
                v-50l10,0.2c12.5,0,21.8-1.9,27.9-5.7c6.2-3.8,11-10.1,14.5-19l7.8-20.3l-86.5-247.7h71L1334.3,406.4L1334.3,406.4z"/>
            <path class="st4" d="M1537.8,382.7v117.1h-68.4V167.4h129.6c25,0,46.9,4.6,65.8,13.7c18.9,9.1,33.5,22.1,43.7,38.9
                c10.2,16.8,15.3,36,15.3,57.4c0,32.6-11.1,58.3-33.4,77.1c-22.3,18.8-53.1,28.2-92.5,28.2H1537.8z M1537.8,327.2h61.1
                c18.1,0,31.9-4.3,41.4-12.8s14.3-20.7,14.3-36.5c0-15.8-4.8-29.5-14.4-39.5c-9.6-10-22.8-15.2-39.7-15.5h-62.7V327.2L1537.8,327.2
                z"/>
            <path class="st4" d="M1754.2,188.9c0-9.9,3.3-18,9.9-24.4c6.6-6.4,15.6-9.6,27-9.6c11.4,0,20.2,3.2,26.9,9.6
                c6.7,6.4,10,14.5,10,24.4c0,9.9-3.4,18.3-10.2,24.7c-6.8,6.4-15.7,9.6-26.8,9.6c-11.1,0-20-3.2-26.8-9.6
                C1757.6,207.1,1754.2,198.9,1754.2,188.9L1754.2,188.9z M1824.2,499.8h-66.2v-247h66.2V499.8z"/>
            <path class="st4" d="M1936.4,499.8h-66.2V149.1h66.2V499.8z"/>
            <path class="st4" d="M1968.8,374c0-24.5,4.7-46.3,14.1-65.5c9.4-19.2,23-34,40.7-44.5c17.7-10.5,38.3-15.8,61.7-15.8
                c33.3,0,60.5,10.2,81.6,30.6c21.1,20.4,32.8,48.1,35.2,83.1l0.5,16.9c0,37.9-10.6,68.3-31.7,91.2c-21.1,22.9-49.5,34.4-85.1,34.4
                c-35.6,0-64-11.4-85.2-34.2c-21.2-22.8-31.8-53.9-31.8-93.2L1968.8,374L1968.8,374z M2034.7,378.7c0,23.5,4.4,41.4,13.2,53.9
                c8.8,12.4,21.4,18.6,37.9,18.6s28.4-6.1,37.4-18.4c9-12.3,13.5-31.9,13.5-58.9c0-23-4.5-40.9-13.5-53.5c-9-12.6-21.6-19-37.9-19
                c-16.3,0-28.6,6.3-37.4,18.9C2039.1,332.9,2034.7,352.3,2034.7,378.7z"/>
            <path class="st4" d="M2310.5,192.1v60.7h42.2v48.4h-42.2v123.3c0,9.1,1.8,15.7,5.2,19.6c3.5,4,10.2,5.9,20.1,5.9
                c7.3,0,13.8-0.5,19.4-1.6v50c-12.9,4-26.2,5.9-39.9,5.9c-46.2,0-69.8-23.4-70.7-70.1V301.2h-36v-48.4h36v-60.7H2310.5
                L2310.5,192.1z"/>
        </g>
    </g>
    </svg>
</a>
